<template>
	<view class="projectContainer">
		<!-- 轮播图区域开始 -->
		<view class="swiper">
			<u-swiper :list="list"></u-swiper>
		</view>
		<!-- 轮播图区域结束 -->
		<!-- 内容区域开始 -->
		<view class="projectContent">
			<u-tabs :list="tabList" :is-scroll="false" :current="current" @change="change" bar-width="80" ></u-tabs>
			<projectItem  :key="index" :name="item.projectDesc" v-for="(item,index) in projectData" :imgUrl="item.projectImg" :address="item.projectType" :time="item.projectTime"></projectItem>
		</view>
		<!-- 内容区域结束 -->
	</view>
</template>

<script>
	import projectItem from '../../compontents/projectItem/projectItem'
	export default {
		components:{
			projectItem
		},
		data() {
			return {
				// 轮播图数据
				list: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
				// 指定哪个tab为激活状态
				current: 0,
				// tab标签数据
				tabList: [{
						name: '保鲜库'
					}, {
						name: '冷冻库'
					}, {
						name: '气调库',
					},
					{
						name: '综合性冷库',
					}
				],
				// 最新工程案例数据
				projectData: [{
						projectImg: "../../static/homeImg/1.jpg",
						projectDesc: "南川小型保鲜库施工中",
						projectType: "保鲜库",
						projectTime: "2021-09-21",
						readNum: 20,
						like: 100
				
					},
					{
						projectImg: "../../static/homeImg/2.jpg",
						projectDesc: "江津小型冷冻库施工中",
						projectType: "冷冻库",
						projectTime: "2021-08-21",
						readNum: 60,
						like: 50
				
					}
				],
			};
		},
		methods: {
			change(index) {
				this.current = index
			}
		}
	}
</script>

<style lang="scss" scoped>
	.projectContainer {
		.swiper {
			padding: 10rpx;
		}
	}
</style>
